package com.tandashi.springbootstudy01.study.thread;

public class CountOperate extends Thread {
    public CountOperate() {
        System.out.println(this.currentThread().getName());
        //this.setName("AA");
        /*System.out.println("CountOp -- begin");
        System.out.println("Thread.currentThread().getName() = "+Thread.currentThread().getName());
        System.out.println("this.getName() = "+this.getName());
        System.out.println("CountOp -- end");*/
    }

    @Override
    public void run() {
        //this.setName("BB");
        /*System.out.println("run -- begin");
        System.out.println("Thread.currentThread().getName() = "+Thread.currentThread().getName());
        System.out.println("this.getName() = "+this.getName());
        System.out.println("run -- end");*/
        System.out.println("run="+this.isAlive());

    }

    public static void main(String[] args) throws InterruptedException {
        CountOperate c = new CountOperate();
        System.out.println("begin == "+c.isAlive());
        c.start();
        Thread.sleep(100);
        System.out.println("end == "+c.isAlive());
        System.out.println(currentThread().getName());
        System.out.println(Thread.currentThread().getName());
    }
}
